package database

import (
	"lht-go-plugins/LhtPlugins/Sql/mongo"
	"lht-go-plugins/LhtPlugins/Sql/mysql"
	"lht-go-plugins/LhtPlugins/Sql/postgres"
	"lht-go-plugins/LhtSettings"
)

func NewDatabasePlugin(cfg any) any {
	switch cfg.(type) {
	case *LhtSettings.MysqlConfig:
		return mysql.NewMysqlPlugin()
	case *LhtSettings.PostgresConfig:
		return postgres.NewPostgresPlugin()
	case *LhtSettings.MongoConfig:
		return mongo.NewMongoPlugin()
	default:
		return nil
	}
}
